-
Notifications
You must be signed in to change notification settings - Fork 627
Add support of parsing OPTIMIZE TABLE statement for ClickHouse #1359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
452481a
to
9ee8988
Compare
Pull Request Test Coverage Report for Build 10181475346Details
💛 - Coveralls |
ClickHouse supports using `OPTIMIZE TABLE` to initialize an unscheduled merge of data parts for tables. The syntax is following: ```SQL OPTIMIZE TABLE [db.]name [ON CLUSTER cluster] [PARTITION partition | PARTITION ID 'partition_id'] [FINAL] [DEDUPLICATE [BY expression]] ``` See: https://clickhouse.com/docs/en/sql-reference/statements/optimize
a95222a
to
3c0b347
Compare
#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] | ||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] | ||
#[cfg_attr(feature = "visitor", derive(Visit, VisitMut))] | ||
pub struct Partition { | ||
pub partitions: Vec<Expr>, | ||
pub enum Partition { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the type of Partition
from struct
to enum
to support more parsing states.
cc @iffyio |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple minor comments re naming but the changes look good to me overall! Thanks!
cc @alamb
7fd63d0
to
b4e7026
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…e#1359) # Conflicts: # src/ast/ddl.rs # src/ast/mod.rs # src/parser/mod.rs # tests/sqlparser_clickhouse.rs
ClickHouse supports using
OPTIMIZE TABLE
to initialize an unscheduled merge of data parts for tables. The syntax is following:See: https://clickhouse.com/docs/en/sql-reference/statements/optimize